package com.ruoyi.system.domain;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.system.entity.AbdulBaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

/**
 * 商品库存 Entity
 *
 * @author ruoyi
 * @date 2025-06-04
 */
@EqualsAndHashCode(callSuper = true)
@ApiModel("门店商品库存信息")
@Data
@TableName("inv_product_inventory")
public class ProductInventory extends AbdulBaseEntity {

    @ApiModelProperty(value = "主键ID", example = "1")
    private Long id;

    @ApiModelProperty(value = "商品名称", required = true, example = "红茶")
    @Excel(name = "商品名称")
    private String name;

    @ApiModelProperty(value = "商品规格", example = "250g/罐")
    @Excel(name = "商品规格")
    private String specification;

    @ApiModelProperty(value = "商品类别", example = "茶叶")
    @Excel(name = "商品类别")
    private String category;

    @ApiModelProperty(value = "商品分类", example = "饮品")
    @Excel(name = "商品分类")
    private String classification;

    /**
     * 商品库中商品id
     */
    @ApiModelProperty(value = "商品库中商品id")
    private Long productManagementId ;

    @ApiModelProperty(value = "商品编号")
    @Excel(name = "商品编号")
    private String code;

    @ApiModelProperty(value = "单位", example = "罐")
    @Excel(name = "单位")
    private String unit;

    @ApiModelProperty(value = "仓库ID", example = "1001")
    private Long warehouseId;

    @ApiModelProperty(value = "是否参与库存（1-参与，0-不参与）", example = "1")
    private Integer inStock;

    @ApiModelProperty(value = "库存下限", example = "10")
    @Excel(name = "库存下限")
    private Integer minStock;

    @ApiModelProperty(value = "库存上限", example = "100")
    @Excel(name = "库存上限")
    private Integer maxStock;

    @ApiModelProperty(value = "库存预警（2-上限报警，1-下限报警，0-正常）", example = "0")
    private Integer stockWarning;

    @ApiModelProperty(value = "库存数量", example = "50")
    @Excel(name = "库存数量")
    private Integer stockQuantity;

    @ApiModelProperty(value = "库存单价（元）", example = "88.00")
    @Excel(name = "库存单价")
    private BigDecimal unitPrice;

    @ApiModelProperty(value = "库存总值（元）", example = "4400.00")
    @Excel(name = "库存总值")
    @TableField(value = "total_value",
            insertStrategy = FieldStrategy.NEVER,
            updateStrategy = FieldStrategy.NEVER)
    private BigDecimal totalValue;


    @ApiModelProperty(value = "商品售价（元）", example = "128.00")
    @Excel(name = "商品售价")
    private BigDecimal sellingPrice;

    //DTO
    @ApiModelProperty("仓库名称")
    @TableField(exist = false)
    @Excel(name = "仓库名称")
    private String warehouseNameDesc;

    @ApiModelProperty(value = "库存预警")
    @Excel(name = "库存预警")
    @TableField(exist = false)
    private String stockWarningDesc;

    @ApiModelProperty(value = "是否参与库存（1-参与，0-不参与）", example = "1")
    @TableField(exist = false)
    @Excel(name = "是否参与库存", readConverterExp = "1=参与,0=不参与")
    private String inStockDesc;


}
